cmake_minimum_required(VERSION 2.6)

project(face_detection)

option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug)

find_package(CUDA REQUIRED)

include_directories(${PROJECT_SOURCE_DIR}/include)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
    include_directories(/usr/local/cuda/targets/aarch64-linux/include)
    link_directories(/usr/local/cuda/targets/aarch64-linux/lib)
else()
    include_directories(/usr/local/corex/include)
    link_directories(/usr/local/corex/lib64)
endif()


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Ofast -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED")



find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(face_detectors ${PROJECT_SOURCE_DIR}/face_detectors.cpp)
target_link_libraries(face_detectors ixrt)
target_link_libraries(face_detectors ixrt_plugin)
target_link_libraries(face_detectors cudart)
target_link_libraries(face_detectors ${OpenCV_LIBS})
target_link_libraries(face_detectors dl)

add_definitions(-O2 -pthread)
